<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" lang="zh-CN">
<head>
    <meta charset="utf-8"/>
    <title>CMS后台管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link th:replace="resource :: css" rel="stylesheet"/>
</head>
<body>
<div class="container-fluid">
    <nav class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <a class="navbar-brand" href="javascript:void(0);">评论管理</a>
            </div>
        </div>
    </nav>
    <table class="table table-bordered table-hover">
        <thead>
        <tr>
            <td colspan="5"></td>
            <td>
                <button class="btn btn-success btn-sm update-item" modal-id="update-modal">新建</button>
            </td>
        </tr>
        <tr>
            <th>ID</th>
            <th>文章ID</th>
            <th>用户ID</th>
            <th>评论内容</th>
            <th>状态</th>
            <th width="93px">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="entity : ${page.content}">
        <tr>
            <td th:text="${entity.id}"></td>
            <td th:text="${entity.articleId}"></td>
            <td th:text="${entity.userId}"></td>
            <td th:text="${entity.content}"></td>
            <td>#if($entity.display)显示#else 隐藏#end</td>
            <td>
                <button class="btn btn-success btn-xs update-item" data-id="$!entity.id" modal-id="update-modal">编辑</button>
                <button class="btn btn-danger btn-xs remove-item" data-id="$!entity.id">删除</button>
            </td>
        </tr>
        </tbody>
    </table>
    #set($i=$!page.number + 1)
    <ul class="pagination" style="float:right" total="$!page.totalPages" index="$i"></ul>
</div>
<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="true" id="update-modal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h3>评论编辑</h3>
            </div>
            <form class="form-horizontal" action="update">
                <input type="text" style="display: none" name="id">
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">状态</label>
                        <div class="col-sm-10">
                            <input type="radio" name="display" value="true" checked>显示
                            <input type="radio" name="display" value="false">隐藏
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">文章ID</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" placeholder="" name="articleId">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">用户ID</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" placeholder="" name="userId">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">评论内容</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" placeholder="" name="content">
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-success" data-dismiss="modal" aria-hidden="true">关闭</button>
                    <button class="btn btn-primary submit-item" type="button" modal-id="update-modal">保存</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script th:replace="resource :: js"></script>
#include("commons/support-image.vm")
</body>
</html>